﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Belyn.Common.Web
{
    public delegate void DownloadDelegate(IDownload d);
    public delegate void DownloadFailedDelegate(IDownload d,string message);
    public interface IDownload
    {
        void Download();
        void Stop();
        void Continue();
        void Suspend();
        void Cancel();
        double Progress { get; }
        double Speed { get; }
        string FileName {get;}
        string Title { get;  }
        bool Over { get; }

        DownloadState State { get; }

        event DownloadDelegate Downloading;
        event DownloadDelegate Started;
        event DownloadDelegate Stoped;
        event DownloadDelegate Canceled;
        event DownloadDelegate Suspended;
        event DownloadDelegate SpeedChanged;
        event DownloadFailedDelegate Failed;
    }
}
